namespace Expect.Documentation.Reporting
{
    using System;
    using Expect.Core;
    using Expect.Core.Fixtures;
    using Microsoft.VisualStudio.TestTools.UnitTesting;
    
    
    // This file is generated, if you modify content you will lose your modifications when the generator will regenerate the file
    [System.CodeDom.Compiler.GeneratedCodeAttribute("Expect.Core", "0.5.2.0")]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [TestClass()]
    [SpecificationContainerAttribute(Name="Getting specification out !", Path="\\Reporting\\Getting specification out !.expect")]
    public partial class GettingSpecificationOutContainer : Expect.Core.AbstractSpecificationContainer
    {
        
        partial void PrepareContextExtension();
        
        partial void BeforeInitExtension();
        
        partial void AfterInitExtension();
        
        partial void BeforeTeardownExtension();
        
        partial void AfterTeardownExtension();
        
#line 1 "Getting specification out !.expect"
#line hidden
        
        public override void InitializeContext()
        {
            base.InitializeContext();
            PrepareContextExtension();
        }
        
        [TestInitialize()]
        public virtual void GettingSpecificationOutClass_TestInit()
        {
            InitializeContext();
            BeforeInit();
            BeforeInitExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterInit();
            AfterInitExtension();
        }
        
        [TestCleanup()]
        public virtual void GettingSpecificationOutClass_TestTeardown()
        {
            BeforeTeardown();
            BeforeTeardownExtension();

            SpecificationDefinition spec = new SpecificationDefinition();
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }

            AfterTeardown();
            AfterTeardownExtension();
        }
        
        // TestComment
        [TestMethod()]
        public virtual void GettingSpecificationOut()
        {
            SpecificationDefinition spec = new SpecificationDefinition();
            Get_GettingSpecificationOut(spec);
            spec.CalculateResult();

            if ((spec.Status.Success.HasValue == false))
            {
                Assert.Inconclusive(spec.GetMessageForInconclusiveResult());
            }
            if ((spec.Status.Success.Value == false))
            {
                Assert.Fail(spec.GetMessageForFailedResult());
            }
        }
        
        [SpecificationProviderAttribute(Name="Getting specification out !")]
        public virtual void Get_GettingSpecificationOut(Expect.Core.SpecificationDefinition spec)
        {
            spec.Context = Context;
            spec.Name = "Getting specification out !";
            FixtureDefinition fixture = null;

            fixture = spec.AddFixture<DescriptionFixture>();
#line 1
            fixture.WithRow("For now we focused on the executable part of the specifications, but the goal of " +
                    "writing specifications/tests in a natural language is to be able to share and co" +
                    "mmunicate on those elements.");
#line 2
            fixture.WithRow("It\'s often convenient to generate a documentation from the specifications. For no" +
                    "w, Expect generate reports as Word documents using OpenXml SDK.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 4
            fixture.WithRow(@"The use of OpenXML brings some benefits. The document generation don't need Word to be installed on the device running Expect, and the generation is faster than most other ways to generate Word documents. The drawback is that you could only generate docx format, and you cannot define layout elements (like tables of content).");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 6
            fixture.WithRow("The reporting is generated by a console application that takes your test assembly" +
                    " as an input, along with a Word document that is used as a template.");
#line 7
            fixture.WithRow("Expect reporting will build a logical tree of your specifications according to th" +
                    "e folder structure, and use Word\'s style to shape the different elements.");
#line 8
            fixture.WithRow("It means that your template document must contains styles (it does not when you c" +
                    "reate a blank Word document).");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 10
            fixture.WithRow("You could define Word-styles for the following elements : headings, tables, speci" +
                    "fications, and descriptions.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 12
            fixture.WithRow("The report parameters (like styles) could be defined as arguments to the report c" +
                    "ommand line, or as elements in the configuration file of your assembly.");
#line 13
            fixture.WithRow("The report config looks like the following (you must have added the the expect se" +
                    "ction in your configuration file)");
#line 14
            fixture.WithRow("{{");
#line 15
            fixture.WithRow("<report");
#line 16
            fixture.WithRow("      template=\"..\\..\\DocumentTemplate.docx\" ");
#line 17
            fixture.WithRow("      output=\"ExpectDocumentation.docx\" ");
#line 18
            fixture.WithRow("      headings=\"Titre1;Titre2;Titre3\"");
#line 19
            fixture.WithRow("      descriptions=\"Description\"");
#line 20
            fixture.WithRow("      tables=\"Tramemoyenne1-Accent1\"");
#line 21
            fixture.WithRow("      specifications=\"Specifications\"");
#line 22
            fixture.WithRow("      verbose=\"1\">");
#line 23
            fixture.WithRow("      <tokens>");
#line 24
            fixture.WithRow("        <add token=\"!\" underline=\"true\" bold=\"true\" italic=\"true\"/>");
#line 25
            fixture.WithRow("      </tokens>");
#line 26
            fixture.WithRow("      <blocs>");
#line 27
            fixture.WithRow("        <add stylename=\"Samples\" starttoken=\"{{\" endtoken=\"}}\" />");
#line 28
            fixture.WithRow("      </blocs>");
#line 29
            fixture.WithRow("    </report>");
#line 30
            fixture.WithRow("}}");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 32
            fixture.WithRow(@"You could apply basic formatting to the generated docs by using markups in the descriptions. The markups could be tokens to add text formatting like bold (*), italic (@) or underline (_). In addition to the predefined tokens, you could define your own tokens.");
#line 33
            fixture.WithRow("You could also define blocs. The bloc tokens should be alone on a description lin" +
                    "e. Descriptions contained in blocs use the Word\'s style defined for the bloc.");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 35
            fixture.WithRow(@"You could generate the document directly from Visual Studio. For this, you must have a report configuration in your app.config file, and the template file must be declared. If you fullfill those requirements, you just have to right click on the project node and select ""Generate specification"".");
#line hidden
            fixture.EndRun();

            fixture = spec.AddFixture<DescriptionFixture>();
#line 37
            fixture.WithRow("There is a two versions of the command line tool. The default one (Expect.Report." +
                    "Word.exe) is compiled for .Net 4. The other one (Expect.Report.Word.35) is compi" +
                    "led for .Net 3.5. Both tools share the exact same functionnalities.");
#line hidden
            fixture.EndRun();

        }
    }
}
